|
1
|
|
|
import { SpriteData } from './../../data/savefile-expanded/fragments/SpriteData'; |
|
2
|
|
|
/** |
|
3
|
|
|
Copyright 2018 June Hanabi |
|
4
|
|
|
|
|
5
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); |
|
6
|
|
|
you may not use this file except in compliance with the License. |
|
7
|
|
|
You may obtain a copy of the License at |
|
8
|
|
|
|
|
9
|
|
|
http://www.apache.org/licenses/LICENSE-2.0 |
|
10
|
|
|
|
|
11
|
|
|
Unless required by applicable law or agreed to in writing, software |
|
12
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, |
|
13
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14
|
|
|
See the License for the specific language governing permissions and |
|
15
|
|
|
limitations under the License. |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
import { SaveFileService } from './../../data/savefile.service'; |
|
19
|
|
|
import { Component } from '@angular/core'; |
|
20
|
|
|
|
|
21
|
|
|
@Component({ |
|
22
|
|
|
selector: 'screen-area-sprites', |
|
23
|
|
|
templateUrl: './area-sprites.component.pug', |
|
24
|
|
|
styleUrls: ['./area-sprites.component.scss'], |
|
25
|
|
|
}) |
|
26
|
|
|
export class AreaSpritesComponent { |
|
27
|
|
|
constructor( |
|
28
|
|
|
public fileService: SaveFileService, |
|
29
|
|
|
) { } |
|
30
|
|
|
|
|
31
|
|
|
get entries() { |
|
32
|
|
|
return this.fileService.fileDataExpanded.area.sprites.spriteData; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
onAdd() { |
|
36
|
|
|
this.fileService.fileDataExpanded.area.sprites.spriteData.push(new SpriteData(true)); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
onRem(i: number) { |
|
40
|
|
|
this.fileService.fileDataExpanded.area.sprites.spriteData.splice(i, 1); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
onFullView(entry: any) { |
|
44
|
|
|
if (this.fullView == entry) |
|
45
|
|
|
this.fullView = null; |
|
46
|
|
|
else |
|
47
|
|
|
this.fullView = entry; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public fullView: any | null = null; |
|
51
|
|
|
} |
|
52
|
|
|
|